package org.example.controller;

import lombok.RequiredArgsConstructor;
import org.example.domain.ResponseResult;
import org.example.domain.dto.CityListDto;
import org.example.service.CityService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/city")
@RequiredArgsConstructor
public class CityController {

    private final CityService cityService;


    @PostMapping("/getCityList")
    public ResponseResult getCityList(@RequestBody CityListDto cityListDto){

        return cityService.getCityList(cityListDto);
    }

    @GetMapping("/getAllCities")
    public ResponseResult getAllCities(){
        return cityService.getAllCities();
    }

    @PutMapping("/updateViewCount/{id}")
    public ResponseResult updateViewCount(@PathVariable Integer id){
        return cityService.updateViewCount(id);
    }

    @GetMapping("/getCityDetail/{id}")
    public ResponseResult getCityDetail(@PathVariable Integer id){
        return cityService.getCityDetail(id);
    }

    @GetMapping("/recommendCity")
    public ResponseResult recommendCity(){

        return cityService.recommendCity();

    }
}
